package com.kfm.spring.config;

import org.apache.commons.dbutils.QueryRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.sql.DataSource;

@Configuration
@ComponentScan({"com.kfm.spring.dao", "com.kfm.spring.service"})
@Import(JDBCConfig.class)
public class SpringConfig {

    @Bean(name = "queryRunner")
    public QueryRunner getQueryRunner(DataSource dataSource){
        return new QueryRunner(dataSource);
    }
}
